package com.foreknow.service.impl;

import com.foreknow.dao.ConstantitemMapper;
import com.foreknow.entity.Constantitem;
import com.foreknow.service.ConstantitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConstantitemServiceImpl implements ConstantitemService {
    @Autowired
    ConstantitemMapper constantitemMapper;

    //查询所有常数方法
    @Override
    public List<Constantitem> queryAll() { return constantitemMapper.selectAll(); }
    //查询所有常数方法(1对1关联映射)
    @Override
    public List<Constantitem> queryOk() {
        return constantitemMapper.selectOk();
    }

    //根据id查询常数
    @Override
    public Constantitem queryById(int id) {
        return constantitemMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insetyCon(Constantitem constantitem) {
        return constantitemMapper.insertSelective(constantitem);
    }

    //根据id删除
    @Override
    public int deleteByid(int id) {
        return constantitemMapper.deleteByPrimaryKey(id);
    }
    //修改方法
    @Override
    public int updateCon(Constantitem constantitem) {
        return constantitemMapper.updateByPrimaryKeySelective(constantitem);
    }

    @Override
    public List<Constantitem> queryByChoose(Constantitem constantitem) {
        return constantitemMapper.selectByChoose(constantitem);
    }


}
